﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Yipusoft.TranslateApprove.Model;
using Yipusoft.TranslateApprove.BLL;

public partial class Police_TranslateApprove_AppalyDisplay : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Bind();
        }
    }
    private void Bind()
    {
        if (Request["FID"] == null)
            return;

        ApplyInfo info = Yipusoft.TranslateApprove.BLL.Apply.GetApply(new Guid(Request["FID"]));
        if (info == null)
            return;

        lblTitle.Text = info.Title;
        lblName.Text = Yipusoft.Account.BLL.User.GetUser(info.UserID).UserName;
        LinkFile.NavigateUrl = "WordFile/" + info.FilePath;


        BindTable(new Guid(Request["FID"]));

        lblState.Text = SetupLog.GetCurrentState(new Guid(Request["FID"]));
        if (lblState.Text == "审批通过")
        {
            lblState.ForeColor = System.Drawing.Color.Red;

        }
    }

    private void BindTable(Guid FID)
    {
        List<SetupLogInfo> list = SetupLog.GetList(" Fid='" + FID + "'");
        if (list.Count > 1)
        {
            foreach (SetupLogInfo info in list)
            {
                if (info.Remark != "")
                {
                    lblRemark.Text += info.Remark + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;审批人：" + info.UserName + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;审批时间：" + info.RTime + "<br/>";
                }
            }
        }
        else
        {
            lblRemark.Text = "没有审批记录！";
        }
    }

}
